<template>
  <div>
    <mt-header title="新闻" class="header" fixed>
      <router-link to="" slot="left">
        <mt-button icon="back" @click="$router.go(-1)">返回</mt-button>
      </router-link>
    </mt-header>
    <div class="bg-right">
      <div class="d-new-d">新闻动态</div>
      <!-- 新闻详情 -->
      <div class="news-xq" v-if="data">
        <div class="news-title">
          {{ data.result[0].dh }}
        </div>
        <div class="news-xq1">
          <p>
            {{ data.result[0].dp1 }}
          </p>
          <div class="news-img">
            <img :src="`/img2/img_details/` + data.result[0].dimg1" alt="" />
          </div>
          <p>
            {{ data.result[0].dp2 }}
          </p>
          <div class="news-img">
            <img :src="`/img2/img_details/` + data.result[0].dimg2" alt="" />
          </div>
          <p>
            {{ data.result[0].dp3 }}
          </p>
          <div class="news-img">
            <img :src="`/img2/img_details/` + data.result[0].dimg3" alt="" />
          </div>
          <p>
            {{ data.result[0].dp4 }}
          </p>
          <div class="news-img">
            <img :src="`/img2/img_details/` + data.result[0].dimg4" alt="" />
          </div>
          <p>
            {{ data.result[0].dp5 }}
          </p>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  props: ["nid"],
  data() {
    return {
      data: null,
    };
  },
  mounted() {
    this.getData();
  },
  methods: {
    getData() {
      let url = "news/details/" + this.nid;
      this.axios.get(url).then((res) => {
        // console.log(res)
        this.data = res.data;
      });
    },
  },
};
</script>

<style lang="scss" scoped>
.bg-right{
    margin: 8vh 0px;
    padding: 0px 5px;
    padding-bottom: 5px;

}
img{
    width: 100%;
}
</style>